<?php
namespace app\cms\controller;

class Info extends AdminBase
{
    public function set()
    {
        $info=model("CmsInfo");
        $where=['cms_id'=>$this->cms['id']];
        $info['cms_id']=$this->cms['id'];
        $data=$info->get($where);
        if(request()->isPost()){

            if($data==null){
                $info->allowField(true)->save($_POST);
            }else{
                $info->allowField(true)->save($_POST,$where);
            }
            $data=$info->get($where);
            $this->assign("msg","修改成功");
        }
        $this->assign("info",$data);
        return view();
    }

}
